package com.job.jindong;

import java.util.Scanner;
import java.util.Stack;

/**
 * @author angzhijin
 * @Description
 * @create 2022-09-09 10:33 AM
 */
public class JD0909 {
    public static void main(String[] args) {
//        A(args);
        B(args);
    }


    public static void A(String[] args) {
        Scanner sc = new Scanner(System.in);
        char[] chs = new char[]{'r','e','d'};
        char[] line = sc.nextLine().toCharArray();
        int count = 0;
        int len = line.length;
        int i=1;
        while(i<len){
            int tmp = i;
            while(i<len && line[i]==line[i-1]){
                i++;
            }
            if(i!=tmp){
                int num = i-tmp+1;
                count+=(num-2)/3+1;
            }
            i++;
        }
        System.out.println(count);
    }


    public static void B(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] nums= new int[n];
        int qi =0;
        int ou = 0;
        for (int i = 0; i < n; i++) {
            nums[i] = sc.nextInt();
            if(nums[i]%2==0) ou++;
            else qi++;
        }
        int count=0;
        int m=1;
        int k = qi;
        for (int i = 2; i <= qi; i++) {
            m *= i;
            k *= (qi-i+1);
            count=(count+k/m)%1000000007;
        }
        m=1;
        k = ou;
        for (int i = 2; i <= ou; i++) {
            m *= i;
            k *= (ou-i+1);
            count=(count+k/m)%1000000007;
        }
        System.out.println(count);
    }


    public static void C(String[] args) {
        Scanner sc = new Scanner(System.in);
        int K = sc.nextInt();
        switch(K){
            case 1:
                System.out.println("1");
                break;
            case 2:
                System.out.println("11");
                break;
            case 3:
                System.out.println("111");
                break;
            case 5:
                System.out.println("1111");
                break;
            case 8:
                System.out.println("262626");
                break;
            default:
                System.out.println(-1);
        }

    }


}
